Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable use-defusedxml codemod #95

Merged
merged 4 commits into from
Oct 25, 2023
Merged

Enable use-defusedxml codemod #95

merged 4 commits into from
Oct 25, 2023

Conversation

drdavella
Copy link
Member

@drdavella drdavella commented Oct 24, 2023

Overview

Enable use-defusedxml codemod

Description

  • Enabled use-defusedxml, added a description and integration test
  • Fixed an issue with the dependency manager

@drdavella drdavella force-pushed the enable-defusedxml branch 4 times, most recently from d9ea81c to bbd3d51 Compare October 24, 2023 20:30
@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Merging #95 (bbd3d51) into main (6187027) will increase coverage by 0.05%.
Report is 13 commits behind head on main.
The diff coverage is 100.00%.

❗ Current head bbd3d51 differs from pull request most recent head 15cd63f. Consider uploading reports for the commit 15cd63f to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #95      +/-   ##
==========================================
+ Coverage   95.72%   95.77%   +0.05%     
==========================================
  Files          49       49              
  Lines        2012     2013       +1     
==========================================
+ Hits         1926     1928       +2     
+ Misses         86       85       -1     
Files Coverage Δ
src/codemodder/dependency_manager.py 92.45% <100.00%> (+1.88%) ⬆️
src/core_codemods/__init__.py 100.00% <100.00%> (ø)

@drdavella drdavella marked this pull request as ready for review October 24, 2023 20:42

original_code, _ = original_and_expected_from_code_path(code_path, [])
expected_new_code = """\
from io import StringIO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can now indent?

@@ -89,8 +89,10 @@ def dependencies(self) -> dict[Requirement, None]:
self._lines = f.readlines()

return {
Requirement(line): None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the intention here was order preservation? not sure but change LGTM

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that makes sense. We actually don't need that anymore since we preserve the original lines, but we still want to check for the presence of existing dependencies, and we want to do it on the basis of name only (and not version).

@drdavella drdavella merged commit ac628f1 into main Oct 25, 2023
9 checks passed
@drdavella drdavella deleted the enable-defusedxml branch October 25, 2023 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants